package com.jeespring.chapter01.section04;

class MyThread02 extends Thread{
	
	public MyThread02() {
		System.out.println("begin");
		System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
		System.out.println("Thread.currentThread().isAlive() = " + Thread.currentThread().isAlive());
		System.out.println("this.getName() = " + this.getName());
		System.out.println("this.isAlive() = " + this.isAlive());
		System.out.println("end");
	}

	public void run() {
		System.out.println("run - begin");
		System.out.println("run - Thread.currentThread().getName() = " + Thread.currentThread().getName());
		System.out.println("run - Thread.currentThread().isAlive() = " + Thread.currentThread().isAlive());
		System.out.println("run - this.getName() = " + this.getName());
		System.out.println("run - this.isAlive() = " + this.isAlive());//
		System.out.println("run - end");	}
}
public class Thread02{
	public static void main(String[] args) {
		MyThread02 myThread = new MyThread02();//main true Thread-0 false 
		Thread thread = new Thread(myThread);
		System.out.println("main begin thread isAlive=" + thread.isAlive());//false
		thread.setName("A");
		thread.start();//A true Thread-0 true
		System.out.println("main end thread isAlive=" + thread.isAlive());//true

	}
}
